package scm.erp.core.enums;

import com.fasterxml.jackson.annotation.JsonValue;
import scm.erp.core.mybatis.type.EnumValue;

public enum RetCodeEnum {
    OK(200, "OK"),
    BAD_REQUEST(400, "请求错误!"),
    UNAUTHORIZED(401, "未授权!"),
    FORBIDDEN(403, "隐藏资源!"),
    NOT_FOUND(404, "资源不存在!"),
    METHOD_NOT_ALLOWED(405, "方法不允许!"),
    INTERNAL_SERVER_ERROR(500, "服务器内部错误!"),
    NOT_IMPLEMENTED(501, "未实现"),
    BAD_GATEWAY(502, "网关错误!"),
    SERVICE_UNAVAILABLE(503, "服务不可用!"),
    GATEWAY_TIMEOUT(504, "网关超时!"),
    //继续定义其他错误码
    FAIL(9998, "业务失败!"),
    UNKNOWN_EXCEPTION(9999, "未知异常!"),
    ;
    @JsonValue
    @EnumValue
    private final int value;
    private final String name;

    RetCodeEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }
}
